<nc-component v-bind:data="data[index]" v-bind:class="['graphic-navigation']">

	<!-- 预览 -->
	<template slot="preview">
		
		<template v-if="nc.lazyLoad">
			<graphic-nav></graphic-nav>
		</template>

	</template>
	
	<!-- 编辑 -->
	<template slot="edit">
	
		<template v-if="nc.lazyLoad">
			<graphic-nav-list></graphic-nav-list>
		</template>
		
	</template>
	
	<!-- 资源 -->
	<template slot="resource">
		
		<js>
			var RESOURCEPATH = "RESOURCE_PATH";
			var DIYVIEWIMG = "DIYVIEW_IMG";
		</js>
		<css src="RESOURCE_PATH/component/view/graphic_nav/css/design.css"></css>
		<js src="RESOURCE_PATH/component/view/graphic_nav/js/design.js"></js>
		
	</template>
	
	<template slot="verify">
		function verify(){
			var res = { code : true, message : "" };
			
			$(".draggable-element[data-index='{{index}}'] .graphic-navigation .graphic-nav-list>ul>li").each(function(index){
			
				if(vue.data[{{index}}].selectedTemplate == "imageNavigation"){
					$(this).find("input[name='title']").removeAttr("style");//清空输入框的样式
					//检测是否有未上传的图片
					if(vue.data[{{index}}].list[index].imageUrl == ""){
						res.code = false;
						res.message = "请选择一张图片";
						$(this).find(".error-msg").text("请选择一张图片").show();
						return res;
					}else{
						$(this).find(".error-msg").text("").hide();
					}
				}else{
					if(vue.data[{{index}}].list[index].title == ""){
						res.code = false;
						res.message = "请输入标题";
						$(this).find("input[name='title']").attr("style","border-color:red !important;").focus();
						$(this).find(".error-msg").text("请输入标题").show();
						return res;
					}else{
						$(this).find("input[name='title']").removeAttr("style");
						$(this).find(".error-msg").text("").hide();
					}
				}
			});
			
			return res;
		}
	</template>

</nc-component>